<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var arr=[82, 81, 79, 75, 84];
        for(var i=0;i<arr.length; i++){
            var sum=i+1;
alert("第"+sum+"位同学成绩是："+arr[i]);
        }
        alert("数组长度为"+arr.length);
    </script>
</body>
</html>